<!DOCTYPE html>
<html>

<head>
    <title>amap-webgl-simple</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119.css" />
    <script src="http://webapi.amap.com/maps?v=1.4.2&key=6cb85da518029607d421917b7ddeb94a"></script>
    <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=6cb85da518029607d421917b7ddeb94a"></script>
    <style>
        html,
        body,
        #map {
            height: 100%;
            padding: 0;
            margin: 0;
        }
    </style>
</head>

<body>
    <div id="map"></div>
    <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="../../build/mapv.js"></script>
    <script>
        // var map = new AMap.Map('map', {
        //     resizeEnable: true,
        //     zoom: 13,
        //     center: [116.443571, 39.987549],
        //     mapStyle: 'amap://styles/dark'
        // });

        // 百度地图API功能
        var map = new BMap.Map("map", {
            enableMapClick: false
        }); // 创建Map实例
        map.centerAndZoom(new BMap.Point(113.014081, 28.203235), 10); // 初始化地图,设置中心点坐标和地图级别
        map.enableScrollWheelZoom(true); // 开启鼠标滚轮缩放



        // $.get('../data/beijing-village.json', function (data) {

        var data = [
            // 点数据
            // {
            //     geometry: {
            //         type: 'Point',
            //         coordinates: [107.889067, 30.780497]
            //     },
            //     // fillStyle: 'red',
            //     // size: 200
            // },
            // {
            //     geometry: {
            //         type: 'Point',
            //         coordinates: [107.939659, 30.840048]
            //     },
            //     // fillStyle: 'rgba(255, 255, 50, 0.5)',
            //     // size: 100
            // },
            // 线数据
            {
                geometry: {
                    type: 'LineString',
                    coordinates: [
                        [107.889067, 30.780497],
                        [107.940809, 30.818217],
                        [107.939659, 30.840048]
                    ]
                },
            },
            // 面数据
        ];

        var dataSet = new mapv.DataSet(data);
        var options = {
            fillStyle: 'red',
            strokeStyle: 'red',
            context: 'webgl',
            size: 10,
            lineWidth: 20,
            draw: 'line',
            methods: {
                click: function (item) {
                    console.log("====");
                }
            },
            lineType: 'solid', // 'solid' 或者 'dashed'
        }
        var mapvLayer = new mapv.AMapLayer(map, dataSet, options);
        // });
    </script>
</body>

</html>